import { computed } from 'vue'
import { useSettingsStore } from '@/store'
import { LayoutModeEnum } from '@/constants/app-key'

const settingsStore = useSettingsStore()
const isLeft = computed(() => settingsStore.layoutMode === LayoutModeEnum.Left)
const isTop = computed(() => settingsStore.layoutMode === LayoutModeEnum.Top)
const isLeftTop = computed(() => settingsStore.layoutMode === LayoutModeEnum.LeftTop)

const setLayoutMode = mode => {
  settingsStore.layoutMode = mode
}

export function useLayoutMode() {
  return { isLeft, isTop, isLeftTop, setLayoutMode }
}
